package com.testing.end_imageloader_demo;

import android.app.Application;
import android.os.Environment;

import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;

import java.io.File;

/**
 * Created by Administrator on 2017/3/5.
 */

public class MyApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        File ff = new File(Environment.getExternalStorageDirectory() + "/ccc");

        // 初使化ImageLoader
        ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(this)
                .threadPoolSize(2)// 设置线程池的大小
                .threadPriority(3)// 设置优先级
                .diskCache(new UnlimitedDiscCache(ff))// 自定义磁盘缓存路径
                .build();

        ImageLoader.getInstance().init(configuration);

    }
}
